package com.zt.teacher.controller;

import com.zt.common.pojo.common.JsonResult;
import com.zt.common.pojo.origin.OriginClass;
import com.zt.teacher.service.OriginClassService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * description:
 * author:zt
 * date:2021-12-26
 */
@RestController
@CrossOrigin
@RequestMapping("originClass")
@Api("学校班级模块")
public class OriginClassController {

    @Autowired
    private OriginClassService originClassService;

    @GetMapping("getAll")
    @ApiOperation("获取所有学校原始班级")
    public JsonResult<List<OriginClass>> getAllClass(){
        return JsonResult.success(originClassService.getAllClass());
    }

    @GetMapping("get/{collegeId}")
    @ApiOperation("根据学院id获取学校班级")
    public JsonResult<List<OriginClass>> getClassByCollegeId(@PathVariable int collegeId){
        return JsonResult.success(originClassService.getClassByCollegeId(collegeId));
    }

}
